<template>
  <h3>name: {{name}}</h3>
  <h3>age: {{age}}</h3>
  <h3>email:{{info.email}}</h3>
  <h3>phone:{{info.phone}}</h3>
  <button @click="handler">handler</button>
</template>

<script>
import {ref} from 'vue'
export default {
  name: 'App',
 
  setup(){
    //数据
    let name=ref("张三");
    let age=ref(18);
    let info=ref({
      email:'13521831860@163.com',
      phone:13521831860
    })

    //方法
    function handler(){
      name.value="胡歌";
      age.value=30;
      info.value.email="18921831860@163.com"
      info.value.phone="18921831860"
      console.log(name,age,info);  // RefImpl  reference引用 implement（实现对象）
    }

    return {
      name,
      age,
      info,
      handler
    }

    // return ()=>h('h1','胡歌')
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #2c3e50;
  margin-top: 60px;
}
</style>
